home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / misc / pctrk30a.arj / PCT3DOCS.EXE / DOCS / DPMIINFO.DOC < prev    next >
Text File  |  1994-02-08  |  8KB  |  199 lines

  1. ================================================================
  2. Running a DOS Protected-Mode Program
  3. ================================================================
  4.  
  5. When you run a DOS protected-mode application, you must ensure
  6. that DPMI16BI.OVL (the DPMI server), RTM.EXE (the run-time
  7. manager), and any DLLs used by the application are present in the
  8. current directory, the same directory as the application, or on
  9. the DOS path.
  10.  
  11.  
  12. Protected Mode and Memory
  13. -------------------------
  14.  
  15. A DOS protected-mode program uses DPMI (DOS Protected Mode
  16. Interface) to run in protected mode which gives the application
  17. access to all your computer's memory. With the exceptions
  18. outlined below, the DOS protected-mode technology is completely
  19. transparent and no extra steps are necessary in order to run a
  20. protected-mode application.
  21.  
  22.  
  23. DPMIINST
  24.  
  25. One such exception might be when you run a protected-mode program
  26. for the very first time on a 286-based system. The protected mode
  27. technology uses an internal database which contains various
  28. machine characteristics to determine how to enable protected mode
  29. operation on your system, and configures itself accordingly. If
  30. you have a computer with an older 80286 microprocessor, your
  31. system might not be recognized. You'll see this message when you
  32. try to run a protected-mode application:
  33.  
  34.   Machine not in database (RUN DPMIINST)
  35.  
  36. If you get this message, simply run the DPMIINST program by
  37. typing DPMIINST at the DOS prompt and following the program's
  38. instructions.
  39.  
  40. DPMIINST runs your machine through a series of tests to determine
  41. the best way of enabling protected mode, and automatically
  42. configures accordingly. Once you have run DPMIINST, you won't
  43. have to run it again.
  44.  
  45. Some memory managers, device drivers, and memory-resident (TSR)
  46. programs can interfere with DPMIINST's ability to analyze your
  47. system. If DPMIINST fails, try temporarily disabling or removing
  48. these programs. That gives DPMIINST the unrestricted access it
  49. needs to determine the best way to enter protected mode.
  50.  
  51. Note that running DPMIINST.EXE will never be required on any
  52. system running HIMEM (or equivalent) or on any system based on
  53. an 80386 (or later) processor.
  54.  
  55.  
  56. DPMIMEM
  57.  
  58. By default, the DPMI interface allocates all available extended
  59. memory for its own use. If you don't want all of the available
  60. memory to be taken by the DPMI kernel, you can set a DOS
  61. environment variable to specify the maximum amount of memory to
  62. use. This variable can be entered directly at the DOS prompt or
  63. inserted in your AUTOEXEC.BAT file, using this syntax:
  64.  
  65.   SET DPMIMEM=MAXMEM nnnn
  66.  
  67. where nnnn is the amount of memory in kilobytes.
  68.  
  69. For example, if you have a system with 4MB and want the DPMI
  70. kernel to use only 2MB of it, leaving the other 2MB alone, the
  71. DPMIMEM variable would be set as follows:
  72.  
  73.   SET DPMIMEM=MAXMEM 2048
  74.  
  75. Some memory managers, like QEMM or 386^Max, allow allocating the
  76. same area of memory as either extended or expanded and many older
  77. applications can use only expanded memmory (EMS). By using the
  78. DPMIMEM DOS environment variable to limit the amount of extended
  79. memory used by the DPMI server, your system will still have
  80. expanded memory available for use by older applications.
  81.  
  82.  
  83. RTMRES
  84.  
  85. RTMRES preloads the protected-mode system. Preloading the DPMI
  86. server lets you load a protected-mode program slightly faster.
  87. RTMRES will start a program if you specify a program name as a
  88. parameter. If no parameter is specified, RTMRES will run a DOS
  89. shell. Type EXIT to close the shell.
  90.  
  91. RTMRES is especially useful if you start, exit, and start a
  92. protected-mode program frequently. Normally, every time you run a
  93. protected-mode application, the DPMI server is loaded. If you've
  94. run RTMRES previously, the server is already present, and the
  95. protected-mode application loads faster.
  96.  
  97.  
  98. EXTENDED MEMORY
  99.  
  100. A protected-mode application interacts with the DPMI server
  101. through Borland's run-time manager (RTM.EXE). By default, a
  102. protected-mode application uses all the extended memory reserved
  103. by the DPMI kernel.
  104.  
  105.  
  106. ================================================================
  107. Running A DOS Protected-Mode Program from Windows
  108. ================================================================
  109.  
  110. A DOS protected-mode program will run in Windows in 386 enhanced
  111. mode. To configure the amount of memory available to the
  112. application, create a Windows PIF file. To learn more about PIF
  113. files, see your Microsoft Windows User's Guide.
  114.  
  115.  
  116. Running Your Program in Windows Standard Mode
  117. ---------------------------------------------
  118.  
  119. In order to run a protected-mode program from Windows
  120. standard-mode, you must set the DPMIMEM DOS environment variable
  121. and run RTMRES (both are described above) before running Windows.
  122. Make sure your DPMIMEM setting leaves enough physical memory for
  123. Windows to operate.
  124.  
  125. Note that once you've run RTMRES, you won't be able to run
  126. Windows in 386 enhanced mode until you exit the RTMRES shell (by
  127. typing EXIT at a DOS prompt).
  128.  
  129.  
  130. Running from a Windows DOS Prompt
  131. ---------------------------------
  132.  
  133. To run a DOS protected-mode application from a Windows DOS
  134. prompt, you must first modify the DOSPRMPT.PIF file found in your
  135. Windows directory so that the protected-mode program will be able
  136. to use extended memory.
  137.  
  138. Using the Windows PIF editor, open the DOSPRMPT.PIF file, and
  139. indicate the amount of extended memory you want the
  140. protected-mode program to use. If you are unsure how to use the
  141. PIF editor, see your Microsoft Windows User's Guide.
  142.  
  143.  
  144. ================================================================
  145. Controlling the Amount of Memory the Run-Time Manager Uses
  146. ================================================================
  147.  
  148. The run-time manager attempts to free as much conventional memory
  149. as possible (by moving moveable memory blocks into extended
  150. memory, for example) before starting an application. No attempt
  151. is made to release extended memory, however. Therefore, if you
  152. are going to run other protected-mode applications that don't use
  153. the run-time manager (Paradox 4.0, for example), use the RTM DOS
  154. environment variable to control the run-time manager's allocation
  155. of memory.
  156.  
  157. Use the DOS command line to add the RTM environment variable to
  158. your system's DOS environment. Here is the syntax:
  159.  
  160.   SET RTM=[option nnnn]
  161.  
  162. The following table lists the options you can use. nnnn can be a
  163. decimal number or a hex number in the form of xAB54 or xab54.
  164.  
  165.    Option          Description
  166.    -------------------------------------------------------------
  167.    EXTLEAVE nnnn   Always leave at least nnnn kilobytes of
  168.                    extended memory available. The default value
  169.                    is 640K.
  170.  
  171.    EXTMAX nnnn     Don't allocate more than nnnn kilobytes of
  172.                    extended memory. The default value is 4
  173.                    gigabytes. In Windows, the default value is
  174.                    one-half the available memory.
  175.  
  176.    EXTMIN nnnn     If fewer than nnnn kilobytes are available
  177.                    after applying EXTMAX and EXTLEAVE limits,
  178.                    terminate with an Out of Memory message. The
  179.                    default value is zero.
  180.  
  181.    REALLEAVE nnnn  Always leave at least nnnn paragraphs of real
  182.                    memory available. The default value is 64K or
  183.                    4096 paragraphs.
  184.  
  185.    REALMAX nnnn    Don't allocate more than nnnn paragraphs of
  186.                    real memory. The default value is 1 megabyte
  187.                    or 65,535 paragraphs.
  188.  
  189.    REALMIN nnnn   If fewer than nnnn paragraphs are available
  190.                   after applying REALMAX and REALLEAVE, terminate
  191.                   with an Out of Memory message. The default
  192.                   value is zero.
  193.  
  194. The following DOS command limits RTM to 2M bytes of extended
  195. memory, and ensures that 128K bytes of real memory are left
  196. unallocated:
  197.  
  198.   SET RTM=EXTMAX 2048 REALLEAVE 8192
  199.